<script type="text/javascript">
        $(document).ready(function(){
        $("#cance").click(function(){
            window.location = "<?php echo Router::url(array('controller'=>'providers', 'action'=>'index') ) ?>";
            });
        $("#sb").click(function(){
            $('#ProviderAdminEditForm').submit();
            });
        $("#sb2").click(function(){
            $('#ImageAdminEditForm').submit();
            });

        });
</script>

<?php
$data = $this->request->data;
 //debug($this->request->data); ?>
<div class="box round first">
        <h2><?php echo __('Admin Edit Provider'); ?></h2>
<div class="providers form block">
    <?php
echo $this->Form->create('Image', array(
    'type' => 'file',
    'url' => array(
        'controller' => 'providers',
        'action' => 'change',$data['Provider']['image_id']
    )
));
 ?>
    <?php
        echo $this->Html->image($data['Image']['link'], array(
                "alt" => $data['Image']['name'],
                // 'url' => array('controller' => 'recipes', 'action' => 'view', 6)
                    ));
        echo $this->Form->input(__('file'), array('type' => 'file'));

     ?>
     <?php echo $this->Form->end(); ?>
<?php echo $this->Form->input('Change image', array('id'=>'sb2', 'class' => 'btn btn-green', 'type'=>'button', 'div' => FALSE, 'label' => FALSE)); ?>

<?php
echo $this->Form->create('Provider', array(
    'type' => 'file',
    'url' => array(
        'controller' => 'providers',
        'action' => 'edit',$data['Provider']['id']
    )
));
 ?>
    <fieldset>
    <?php
        echo $this->Form->input('id');
        echo $this->Form->input('name');
        echo $this->Form->input('link');
    ?>
    </fieldset>
<?php echo $this->Form->end(); ?>
<?php echo $this->Form->input('Save', array('id'=>'sb', 'class' => 'btn btn-green', 'type'=>'button', 'div' => FALSE, 'label' => FALSE)); ?>
<?php echo $this->Form->input('Cance', array('id'=>'cance', 'class' => 'btn btn-pink', 'type'=>'button', 'div' => FALSE, 'label' => FALSE)); ?>

</div>
</div>
